import request from '@/plugins/request'
import url from '@/plugins/url'
// let ip = 'http://192.168.96.166:5757';
let ip = 'http://localhost:5757';

/**
 * 获取所有导航
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function get_menu_count(data) {
  return request({
    url: ip+'/api/admin/page_rule_all',
    method: 'POST',
    data: data
  })
}


/**
 * 获取所有导航列表   树类型机构数据
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function get_menu_list(data) {
  return request({
    url: ip+'/api/admin/page_rule_list',
    method: 'POST',
    data: data
  })
}




/**
 * 添加菜单
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function add_menu(data) {
  return request({
    url: ip+'/api/admin/page_rule_add',
    method: 'POST',
    data: data
  })
}

/**
 * 更新菜单
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function edit_menu(data) {
  return request({
    url: ip+'/api/admin/page_rule_edit',
    method: 'POST',
    data: data
  })
}

/**
 * 删除菜单
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function del_menu(data) {
  return request({
    url: ip+'/api/admin/page_rule_del',
    method: 'POST',
    data: data
  })
}